#include <stdio.h>
#include "include/MyGateway.h"

CMyGateway theApp;

int main(int argc, char** argv)
{
	char now[32];
	::memset(now, 0, sizeof(now));

	printf("nwo time: %s\n", xuwn::times::now("yyyy-mm-dd hh:nn:ss", now));

	theApp.Run(argc, argv);

	getchar();
	return 0;
}
class Finelock
{
public:
	Finelock(mutex = ::CreateMutex(NULL, FALSE, NULL); );
	~Finelock();
	void lock(){::WaitForSingleObject(mutex, 0xFFFFFFFF);};
	void unlock(){::ReleaseMutex(mutex); ::CloseHandle(mutex);};
	unsigned long wait(unsigned long tm){return ::WaitForSingleObject(mutex, tm);};
private:
	HANDLE	mutex;
};